package com.ty.util;

import java.util.Random;

/**
 * @author 田野
 */
public class RandomUtil {
    private static Random random = new Random();
    public static String getCode(){
        // 快递柜的行 1-50
        int row = random.nextInt(50) + 1;
        // 快递柜的列 1-30
        int column = random.nextInt(30) + 1;
        // 快递四位短号
        int shortNum = random.nextInt(10000) + 1000;

        // 拼接 11-12-2321
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(row);
        stringBuffer.append("-");
        stringBuffer.append(column);
        stringBuffer.append("-");
        stringBuffer.append(shortNum);

        return stringBuffer.toString();

    }

    public static String getCheckCode(){
        int checkCode = random.nextInt(1000000) + 100000;

        return checkCode + "";

    }
}
